<?php

    header('Content-Type: text/html; charset=UTF-8');
    include_once '../../config.php';

    //Variablen
    $projectnr = $_POST['projectnr'];
    $status    = $_POST['status_choose'];
    $comment   = $_POST['pcomment'];

    if ($status == 0) {
        $sql = "UPDATE project SET get = 0, comment = '" . $comment . "' WHERE project_nr = '" . $projectnr . "'";
        mysql_query($sql);

        header('Location: ../index.php');
    } else if ($status == 1) {
        $sql = "UPDATE project SET get = 1, comment = '" . $comment . "' WHERE project_nr = '" . $projectnr . "'";
        mysql_query($sql);

        header('Location: ../index.php');
    } else {
        $sql = "UPDATE project SET comment = '" . $comment . "' WHERE project_nr = '" . $projectnr . "'";
        mysql_query($sql);
        
        header('Location: ../index.php');
    }

?>
